home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 3
/
CU Amiga Magazine's Super CD-ROM 03 (1996)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1996-09].iso
/
misc
/
gcc
/
gnu
/
libauto
/
baselocale.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-16
|
1KB
|
42 lines
/* call this with the following defines (for example):
LIBRARY_NAME "intuition.library"
LIBRARY_BASE IntuitionBase
LIBRARY_VERS __auto_intui_vers
*/
#include <exec/types.h>
#include <inline/exec.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct LocaleBase * LIBRARY_BASE = 0;
extern int LIBRARY_VERS;
#define STRING(a) a, sizeof (a) - 1
static void
constructor ()
{
/* Since this is for locale.library, we must not exit if locale.library
not exists since then we will use builtin strings
*/
LIBRARY_BASE = (struct LocaleBase* )OpenLibrary (LIBRARY_NAME, LIBRARY_VERS);
}
static void
destructor ()
{ /* There is no need to check if LIBRARY_BASE is NULL, since
CloseLibrary deals with NULL from V36 and locale is for V38+
*/
CloseLibrary ((struct Library* )LIBRARY_BASE);
LIBRARY_BASE = 0;
}
asm (" .text; .stabs \"___CTOR_LIST__\",22,0,0,_constructor");
asm (" .text; .stabs \"___DTOR_LIST__\",22,0,0,_destructor");